<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	var a = [];
	for (let i = 0; i < 10; i++) {
		a[i] = function () {
			console.log(i);
		};
	}
	a[6]();
</script>
</html>